﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using PicSync.Backend;
using Facebook;

namespace PicSync.TESTS
{
    //This class simply tests the code in the class BackEnd.MonitorFolder

    class TEST_BackEnd_UploadPictures
    {
       static void Main()
        {
            
        }

      public static void uploadPicture(String attachementPath)
       {
           var fb = TESTS_BackEnd_FacebookTestClient.getClient();

           using (var file = new FacebookMediaStream
           {
               ContentType = "image/jpeg",
               FileName = Path.GetFileName(attachementPath)
           }.SetValue(File.OpenRead(attachementPath)))
           {
               dynamic result = fb.Post("me/photos",
               new { message = "Test Upload For PicSync", file });
           }
           Console.WriteLine("Posted");

       }
    }
}
